import $axios, { Result } from '@/plugins/axios'
import { AxiosResponse } from 'axios'
import { PageParam } from '@/type'

/**
 * 分页查询待办事项
 * @param pageParam
 */
export async function getNotProcessedMatterByPage(
  pageParam: PageParam,
): Promise<AxiosResponse<Result>> {
  return await $axios.post(
    '/supervision-api/matter/getNotProcessedMatterByPage',
    pageParam,
  )
}

/**
 * 反馈事项期限完成情况
 * @param data
 */
export async function feedbackCompletionDesc(
  data: any,
): Promise<AxiosResponse<Result>> {
  return await $axios.post(
    '/supervision-api/matterFeedback/feedbackCompletionDesc',
    data,
  )
}

/**
 * 反馈事项期限完成情况
 * @param data
 */
export async function getFeedbackByMatterIdAndUnitId(data: {
  matterId: number
  unitId: number
}): Promise<AxiosResponse<Result>> {
  return await $axios.get(
    '/supervision-api/matterFeedback/getFeedbackByMatterIdAndUnitId',
    {
      params: data,
    },
  )
}

/**
 * 反馈事项期限完成情况
 * @param matterId
 */
export async function getUnitByMatterId(
  matterId: number,
): Promise<AxiosResponse<Result>> {
  return await $axios.get('/supervision-api/matterUnits/getUnitByMatterId', {
    params: {
      matterId,
    },
  })
}
